//
//  UIColor+Extension.h
//  JKDynamicColor
//
//  Created by 王冲 on 2019/9/27.
//  Copyright © 2019 王冲. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIColor (Extension)

// Convert hexadecimal value to RGB
+ (UIColor *)colorWithHex:(UInt32)hexadecimal;
///十六进制颜色，如：[UIColor colorWithHexString:@"040b29"];
+ (UIColor *)colorWithHexString:(NSString *)hexadecimal;

// Convert hexadecimal value to RGB
// format:
//    0x = Hexadecimal specifier (# for strings)
//    ff = alpha, ff = red, ff = green, ff = blue
+ (UIColor *)colorWithAlphaHex:(UInt32)hexadecimal;
+ (UIColor *)colorWithAlphaHexString:(NSString *)hexadecimal;

// Return the hexadecimal value of the RGB color specified.
+ (NSString *)hexStringFromColor: (UIColor *)color;

// Generates a color randomly
+ (UIColor *)randomColor;

// ObjC (manual hex conversion to RGB)
///十六进制颜色，如：[UIColor colorWithHexa:@"#eff0f1"];
+ (UIColor *)colorWithHexa:(NSString *)hexadecimal;
/// RGBA颜色
+ (UIColor *)colorSetWithRGB:(unsigned int)red
                       green:(unsigned int)green
                        blue:(unsigned int)blue
                       alpha:(float)alpha;

@end

NS_ASSUME_NONNULL_END
